﻿@using Gardener.Core.Client.OperationDialog
@using Gardener.Core.Module

@page "/system_manager/modules"
@inherits ListOperateTableBase<SystemModuleDto, Int32>
<div>
    <Table @ref="_table"
           TItem="SystemModuleDto"
           DataSource="_datas"
           Total="_total"
           OnChange="OnChange"
           @bind-PageSize="_pageSize"
           @bind-PageIndex="_pageIndex"
           @bind-SelectedRows="_selectedRows"
           Loading="_tableLoading.Value"
           Context="model"
           Size="ClientConstant.DefaultTableSize"
           PaginationPosition="@ClientConstant.TablePaginationPosition"
           RemoteDataSource>
        <TitleTemplate>
            <ResourceAuthorize ResourceKey="system_manager_modules_search">
                <TableSearch TDto="SystemModuleDto" @ref="this._tableSearch" OnSearch="OnTableSearch" Settings="_tableSearchSettings" CustomLocalizer="Localizer" />
            </ResourceAuthorize>
            <Row>
                <AntDesign.Col Span="8">
                </AntDesign.Col>
                <AntDesign.Col Span="16" Style="text-align:right">
                    <Space>
                        <ResourceAuthorize ResourceKey="system_manager_modules_refresh">
                            <SpaceItem>
                                <Button Type="@ButtonType.Primary" Icon="@IconType.Outline.Reload" OnClick="ReLoadTable">
                                    @Localizer[nameof(SharedLocalResource.Refresh)]
                                </Button>
                            </SpaceItem>
                        </ResourceAuthorize>
                    </Space>
                </AntDesign.Col>
            </Row>
        </TitleTemplate>
        <ColumnDefinitions>
            <Column @bind-Field="@model.Id" Filterable />
            <Column @bind-Field="@model.Name" Filterable />
            <Column @bind-Field="@model.Description" Filterable />
            <Column @bind-Field="@model.Order" Filterable DefaultSortOrder="SortDirection.Ascending" />
            <Column @bind-Field="@model.Author" Filterable />
            <Column @bind-Field="@model.Version" Filterable />
            <Column @bind-Field="@model.AuthorHome" Filterable />
        </ColumnDefinitions>
    </Table>
</div>